package cn.dujc.superkid.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author du
 * date 2018/8/2 下午8:40
 */
public class VideoExaminationResult implements Parcelable{
    /**
     * id : 314
     * examination_title : 认识时间（1）测试卷
     * is_test : 1
     * type_id : 2
     * examination_list : [{"id":2984,"problem_title":"<p><span style=\"color: rgb(255, 0, 0);\">（单选题）<\/span>小明睡前给自己定了个闹钟，如下所示，请问是________点________分。<\/p><p><img src=\"http://7xu137.com1.z0.glb.clouddn.com/ueditor_20170217_58a6e437cc16f.png\" title=\"blob.png\" alt=\"blob.png\"/><\/p>","problem_type":1,"exercises_answer":"[\"6:35\",\"6:38\",\"7:30\",\"8:30\"]","correct_answer":"3","explain":"<p>读图可得时间是7点30分<\/p>","is_good":1,"exercises_answer_list":["6:35","6:38","7:30","8:30"]}]
     * examination_num : 10
     * message_list : [{"mid":535,"posttime":1497237244,"content":"<p>试卷第10题，小郭的列式是9+5+9+5+9+5+3，我一开始没明白，后来他解释给我听，发现孩子有另一个思路，很开心！<\/p><p><br/><\/p>","answer_teacher_id":3,"answer_posttime":1497242803,"answer_content":"<p>亲爱的家长，孩子的思路完全是ok的呢，他的意思应该是按折3只，休息下，再折3只，再休息下，再折3只，再休息下，然后再折一只这样的一个思路，然后把所需要的时间进行想加。非常棒，值得鼓励！<\/p>","status":2,"teacher_name":"郑怡婷","username":"郭新然"}]
     */

    private String id;//自测卷id
    private String examination_title;//自测卷标题
    private String is_test;//是否测试过（1-未测试，2-已测试）
    private String type_id;//好题本类型id（用于提供加入好题本type_id）
    private String examination_num;//自测卷试卷数量
    private List<ExaminationListEntity> examination_list;//自测卷试卷列表
    private List<ExaminationMessageListEntity> message_list;//自测卷留言列表

    public String getId() { return id;}

    public void setId(String id) { this.id = id;}

    public String getExamination_title() { return examination_title;}

    public void setExamination_title(String examination_title) { this.examination_title = examination_title;}

    public String getIs_test() { return is_test;}

    public void setIs_test(String is_test) { this.is_test = is_test;}

    public String getType_id() { return type_id;}

    public void setType_id(String type_id) { this.type_id = type_id;}

    public String getExamination_num() { return examination_num;}

    public void setExamination_num(String examination_num) { this.examination_num = examination_num;}

    public List<ExaminationListEntity> getExamination_list() { return examination_list;}

    public void setExamination_list(List<ExaminationListEntity> examination_list) { this.examination_list = examination_list;}

    public List<ExaminationMessageListEntity> getMessage_list() { return message_list;}

    public void setMessage_list(List<ExaminationMessageListEntity> message_list) { this.message_list = message_list;}

    @Override
    public int describeContents() { return 0; }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.examination_title);
        dest.writeString(this.is_test);
        dest.writeString(this.type_id);
        dest.writeString(this.examination_num);
        dest.writeTypedList(this.examination_list);
        dest.writeTypedList(this.message_list);
    }

    public VideoExaminationResult() {}

    protected VideoExaminationResult(Parcel in) {
        this.id = in.readString();
        this.examination_title = in.readString();
        this.is_test = in.readString();
        this.type_id = in.readString();
        this.examination_num = in.readString();
        this.examination_list = in.createTypedArrayList(ExaminationListEntity.CREATOR);
        this.message_list = in.createTypedArrayList(ExaminationMessageListEntity.CREATOR);
    }

    public static final Creator<VideoExaminationResult> CREATOR = new Creator<VideoExaminationResult>() {
        @Override
        public VideoExaminationResult createFromParcel(Parcel source) {return new VideoExaminationResult(source);}

        @Override
        public VideoExaminationResult[] newArray(int size) {return new VideoExaminationResult[size];}
    };

    public static class ExaminationListEntity implements Parcelable{
        /**
         * id : 2984
         * problem_title : <p><span style="color: rgb(255, 0, 0);">（单选题）</span>小明睡前给自己定了个闹钟，如下所示，请问是________点________分。</p><p><img src="http://7xu137.com1.z0.glb.clouddn.com/ueditor_20170217_58a6e437cc16f.png" title="blob.png" alt="blob.png"/></p>
         * problem_type : 1
         * exercises_answer : ["6:35","6:38","7:30","8:30"]
         * correct_answer : 3
         * explain : <p>读图可得时间是7点30分</p>
         * is_good : 1
         * exercises_answer_list : ["6:35","6:38","7:30","8:30"]
         */

        private String id;//试卷id
        private String problem_title;//题目
        private String problem_type;//题目类型（1-单选，2-多选，3-填空）
        private String exercises_answer;//答案
        private String correct_answer;//正确答案（如果是选择题3表示c）
        private String explain;//解析
        private String is_good;//是否加入好题本(1-未加入，2-已加入)
        private List<String> exercises_answer_list;//答案列表

        public String getId() { return id;}

        public void setId(String id) { this.id = id;}

        public String getProblem_title() { return problem_title;}

        public void setProblem_title(String problem_title) { this.problem_title = problem_title;}

        public String getProblem_type() { return problem_type;}

        public void setProblem_type(String problem_type) { this.problem_type = problem_type;}

        public String getExercises_answer() { return exercises_answer;}

        public void setExercises_answer(String exercises_answer) { this.exercises_answer = exercises_answer;}

        public String getCorrect_answer() { return correct_answer;}

        public void setCorrect_answer(String correct_answer) { this.correct_answer = correct_answer;}

        public String getExplain() { return explain;}

        public void setExplain(String explain) { this.explain = explain;}

        public String getIs_good() { return is_good;}

        public void setIs_good(String is_good) { this.is_good = is_good;}

        public List<String> getExercises_answer_list() { return exercises_answer_list;}

        public void setExercises_answer_list(List<String> exercises_answer_list) { this.exercises_answer_list = exercises_answer_list;}

        @Override
        public int describeContents() { return 0; }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.problem_title);
            dest.writeString(this.problem_type);
            dest.writeString(this.exercises_answer);
            dest.writeString(this.correct_answer);
            dest.writeString(this.explain);
            dest.writeString(this.is_good);
            dest.writeStringList(this.exercises_answer_list);
        }

        public ExaminationListEntity() {}

        protected ExaminationListEntity(Parcel in) {
            this.id = in.readString();
            this.problem_title = in.readString();
            this.problem_type = in.readString();
            this.exercises_answer = in.readString();
            this.correct_answer = in.readString();
            this.explain = in.readString();
            this.is_good = in.readString();
            this.exercises_answer_list = in.createStringArrayList();
        }

        public static final Creator<ExaminationListEntity> CREATOR = new Creator<ExaminationListEntity>() {
            @Override
            public ExaminationListEntity createFromParcel(Parcel source) {return new ExaminationListEntity(source);}

            @Override
            public ExaminationListEntity[] newArray(int size) {return new ExaminationListEntity[size];}
        };
    }

}
